<template>
  <div id="app">
    <!-- <div class="nav_bar">
      <transition name="slide-fade">
        <van-nav-bar :title="title" v-on:click-left="goback" left-text="返回" left-arrow v-show="$route.meta.navBar" />
      </transition>
    </div> -->
    <transition name="slide-fade">
      <!-- <keep-alive> -->
        <router-view class="scrollView" :key="$route.fullPath"></router-view>
      <!-- </keep-alive> -->
    </transition>
  </div>
</template>

<script>
import vm from 'vue'
import {mapGetters} from 'vuex'
// import { NavBar } from "vant";
let obData=vm.observable({
      title:"",
      gobackPath:""
})
export default {
  components:{
    
  },
  provide() {
    return {
      obData: obData
    };
  },
  data(){
    return {
      fixed:false
    }
  },
 
  methods:{
    goback(){
      this.$router.go(-1)
    }
  },
  computed: {
    title(){
      return obData.title
    }
  },
  name: "App",
  watch: {
    $route: function (to,form) {
      // console.log(to,form);
      // this.$store.commit('router/setBackPath',form.fullPath);
      // to.meta.title&&(obData.title=to.meta.title);
    },
  },
};
</script>
<style lang="less">
#app {
  padding: 0px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  .nav_bar{
    position:fixed;
    width:100%;
    top:0px;
    z-index:4;
  }
  transform: none; 
  .fixed{
     
      top: 46px;

  }
}
.scrollView {
     position: absolute;
      -webkit-overflow-scrolling: touch;
      right: 0px;
      bottom: 0px;
      left: 0px;
      top:0px;
      // box-shadow:0px 0px 10px #eee;
      overflow:scroll;
      overflow-x: hidden;
  
  
}
.slide-fade-enter-active{
  transition: all 0.6s ease;
}
.slide-fade-leave-active {
  transition: all 0.3s ease;
}
.slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active for below version 2.1.8 */ {
  transform: translateX(20px);
  opacity: 0;
}
</style>
